package cn.jtfadmin.codegen.domain.dto;

import cn.jtfadmin.base.lang.common.domain.dto.SpecConditionDTO;
import lombok.Data;
import org.apache.commons.collections.map.HashedMap;

import java.io.Serializable;
import java.util.*;

@Data
public class VueListTemDataDTO implements Serializable {

    /**
     * 名称
     */
    protected String name;

    /**
     * 页面描述
     */
    protected String description;

    /**
     * 查询参数
     */
    protected List<QueryParamDTO> queryParams = new ArrayList<>();

    /**
     * 查询参数map
     */
    protected Map<String, SpecConditionDTO> queryParamMap = new HashedMap();


    /**
     * 列表显示信息
     */
    protected List<Map<String, String>> columns = new ArrayList<>();


    /**
     * 导入权限标识
     */
    protected String importPerm;

    /**
     * 新增标识
     */
    protected String addPerm;

    /**
     * 删除标识
     */
    protected String delPerm;

    /**
     * 编辑标识
     */
    protected String editPerm;

    /**
     * modaltag
     */
    protected String modalTag;

    /**
     * 导入的urls
     */
    protected String urls;


    protected Map<String,String> urlMap = new HashedMap();
    /**
     * 导入的组件
     */
    protected Set<String> importComs = new HashSet<>();

    /**
     * 导入的组件
     */
    protected Set<String> importComNames = new HashSet<>();

    /**
     * 查询参数
     */
    @Data
    public static class QueryParamDTO {

        protected List<String> queryParamNames;
        /**
         * 查询参数comment
         */
        protected String comment;

        /**
         * 标签类型 a-input, a-input-number
         */
        protected String tag;

        /**
         * 标签参数
         */
        protected String tagParam;

        public QueryParamDTO(List<String> queryParamNames, String comment, String tag, String tagParam) {
            this.queryParamNames = queryParamNames;
            this.comment = comment;
            this.tag = tag;
            this.tagParam = tagParam;
        }

        public QueryParamDTO() {
        }
    }
}
